<template>
  <div>
    <h2>{{fullName}}</h2>
    <button @click="changeName">改变名字</button>
  </div>
</template>

<script>
import {ref , computed } from "vue";

export default {
  setup(){
    const firstName = ref("wmy");
    const lastName = ref("wj");
    const fullName = computed(() => firstName.value +"-" + lastName.value);

    const changeName = () => {
      firstName.value = "wsk"
    }
    
    return{
      fullName,
      changeName
    }
  }
}
</script>

<style scoped>

</style>